package com.zhny.sensor.service;

import com.zhny.sensor.dao.EntrustRepositiry;
import com.zhny.sensor.entity.Entrust;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EntrustService {

    @Autowired
    private EntrustRepositiry entrustRepositiry;

    public Entrust findById(String id) {
        return entrustRepositiry.findById(id).get();
    }

    public void updateEntrust(Entrust entrust) {
        entrustRepositiry.save(entrust);
    }

    public int updateEntrustState(Integer state1, String barcodeNumber, Integer state2) {
        return entrustRepositiry.updateEntrustState(state1,barcodeNumber,state2);
    }

}
